package beans;

import java.sql.Timestamp;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "package")
public class Package // implements Comparable<Package>
{
	private Terminal terminal;
	private Courier courier;
	private int packageId;
	private int packageStatus;
	private int boxId;
	private int flag;// 判断包裹日志的存件或者取件是否写入   0:未写入包裹日志，1：写入存件日志2.存件取件都已写3.反置位4.反置位已下发
	private int detained;// 包裹滞留等级
	private String userPhone;
	private String parcelId;
	private String checkCode;
	private String comments;
	private String belong;
	private Timestamp storeTime;
	private Timestamp getTime;

	public String leftTime;
	public String username;
	public int msgStatus;

	@GenericGenerator(name = "generator", strategy = "native")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "package_id", unique = true, nullable = false)
	public int getPackageId() {
		return packageId;
	}

	public void setPackageId(int packageId) {
		this.packageId = packageId;
	}

	@Column(name = "package_user_mobile_num")
	public String getUserPhone() {
		return userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	@Column(name = "package_parcel_id")
	public String getParcelId() {
		return parcelId;
	}

	public void setParcelId(String parcelId) {
		this.parcelId = parcelId;
	}

	@Column(name = "package_box_id")
	public int getBoxId() {
		return boxId;
	}

	public void setBoxId(int boxId) {
		this.boxId = boxId;
	}

	@Column(name = "package_store_time")
	public Timestamp getStoreTime() {
		return storeTime;
	}

	public void setStoreTime(Timestamp storeTime) {
		this.storeTime = storeTime;
	}

	@Column(name = "package_get_time")
	public Timestamp getGetTime() {
		return getTime;
	}

	public void setGetTime(Timestamp getTime) {
		this.getTime = getTime;
	}

	@Column(name = "package_status")
	public int getPackageStatus() {
		return packageStatus;
	}

	public void setPackageStatus(int packageStatus) {
		this.packageStatus = packageStatus;
	}

	@ManyToOne
	@JoinColumn(name = "package_terminal_id")
	public Terminal getTerminal() {
		return terminal;
	}

	public void setTerminal(Terminal terminal) {
		this.terminal = terminal;
	}

	@Column(name = "package_checkCode")
	public String getCheckCode() {
		return checkCode;
	}

	public void setCheckCode(String checkCode) {
		this.checkCode = checkCode;
	}

	@Column(name = "package_comments")
	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	@Column(name = "package_flag")
	public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	@ManyToOne
	@JoinColumn(name = "package_courier_id")
	public Courier getCourier() {
		return courier;
	}

	public void setCourier(Courier courier) {
		this.courier = courier;
	}

	@Column(name = "package_detained")
	public int getDetained() {
		return detained;
	}

	public void setDetained(int detained) {
		this.detained = detained;
	}

	@Column(name = "package_belong")
	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}
	
	
}
